﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutForEUI.cshtml";
}
<table id="StatArchive_Index_grid" class="easyui-datagrid" style="width:100%;" title="档案分类统计" data-options="
       rownumbers:true,
       singleSelect:true,
       autoRowHeight:false,
       pagination:false,
       fitColumns:true,
       fit:false,
       striped:true,
       checkOnSelect:false,
       selectOnCheck:false,
       toolbar:'#StatArchive_Custom_tb',
       collapsible:false,
       pageSize: @SGArchiveSystem7x.Models.CCommonsModels.PageSize,
       pageList:[10,15,20]">
    <thead frozen="true">
    </thead>
</table>
<div id="StatArchive_Custom_tb" style="padding:5px 10px;">
    <select class="easyui-combobox" labelwidth="60px" style="width:220px" id="StatArchive_Index_cmbArciveTree" label="统计类型" labelalign="right" editable="false" panelHeight="auto">
        <option value="1">年份-类型</option>
        <option value="2">年份-部门</option>
        <option value="3">部门-类型</option>
    </select>
    <a href="javascript:void(0);" class="easyui-linkbutton button-blue" onclick="startStat()" style="width:110px;height:30px;">统计</a>
    <a href="javascript:void(0);" class="easyui-linkbutton button-blue" onclick="startXls()" style="width:110px;height:30px;">导出xls</a>
</div>
<iframe src="" name="StatArchive_Index_frm" id="StatArchive_Index_frm" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>
<script>
    function startStat() {
        var v = $('#StatArchive_Index_cmbArciveTree').combobox('getValue');
        if (v == 1) 
            document.getElementById('StatArchive_Index_frm').src = "/StatArchive/ViewArchive_NDandLX";
        else if (v == 2)
            document.getElementById('StatArchive_Index_frm').src = "/StatArchive/ViewArchive_NDandBM";
        else
            document.getElementById('StatArchive_Index_frm').src = "/StatArchive/ViewArchive_BMandLX";
    }

    function startXls() {
        var sm = document.getElementById('StatArchive_Index_frm');
        alert(sm.src);
        if (document.getElementById('StatArchive_Index_frm').src == '')
            alert('请先统计再导出');
           /// $.messager.alert('提示', '请先统计后再导出xls文件', 'info');
        else
        {
            StatArchive_Index_frm.window.printXLS('tbxls');
        }
    }
</script>

